import service from './request'

/**
 * 查询招聘列表
 * @returns {*}
 */
export const queryWorkList = params => {
  return service({
    url: '/work/query_worklist',
    method: 'get',
    params
  })
};

/**
 * 登录
 * @param data
 * @returns {*}
 */
export const login = data => {
  return service({
    url: '/login/login',
    method: 'post',
    data
  })
};

/**
 * 退出登录
 * @param params
 * @returns {*}
 */
export const loginOut = () => {
  return service({
    url: '/login/user_sign_out',
    method: 'get'
  })
};

/**
 * 获取token
 * @param params
 * @returns {*}
 */
export const getToken = params => {
  return service({
    url: '/login/get_token',
    method: 'get',
    params
  })
};

/**
 * 发送验证码
 * @param params
 * @returns {*}
 */
export const sendCode = params => {
  return service({
    url: '/login/send_code',
    method: 'get',
    params
  })
};

/**
 * 校验验证码
 * @param params
 * @returns {*}
 */
export const mateCode = params => {
  return service({
    url: '/login/mate_code',
    method: 'get',
    params
  })
};

/**
 * 注册
 * @param params
 * @returns {*}
 */
export const registerUser = data => {
  return service({
    url: '/login/add_user',
    method: 'post',
    data
  })
};

/**
 * 忘记密码
 * @param data
 * @returns {*}
 */
export const setPsw = data => {
  return service({
    url: '/login/set_psw',
    method: 'post',
    data
  })
};

/**
 * 获取个人资料
 * @param params
 * @returns {*}
 */
export const selectMaterial = params => {
  return service({
    url: '/login/get_user',
    method: 'get',
    params
  })
};

/**
 * 查询报名记录
 * @param params
 * @returns {*}
 */
export const queryApplyRecord = params => {
  return service({
    url: '/work/query_workorderlist',
    method: 'get',
    params
  })
};

/**
 * 获取七牛云上传token
 * @param params
 * @returns {*}
 */
export const getQiniuToken = params => {
  return service({
    url: '/platform/get_token',
    method: 'get',
    params
  })
};

/**
 * 修改个人资料
 * @param data
 * @returns {*}
 */
export const modifyMaterial = data => {
  return service({
    url: '/login/update_user_img?sgin=' + data.sgin,
    method: 'post',
    data
  })
};

/**
 * 修改密码
 * @param params
 * @returns {*}
 */
export const modifyPsw = params => {
  return service({
    url: '/login/modify_psw',
    method: 'get',
    params
  })
};

/**
 * 查询招聘详情
 * @param params
 * @returns {*}
 */
export const queryWorkParticulars = params => {
  return service({
    url: '/work/query_workdetail',
    method: 'get',
    params
  })
};

/**
 * 入职报名
 * @param params
 * @returns {*}
 */
export const entryApply = data => {
  return service({
    url: '/work/entryApply?sgin=' + data.sgin,
    method: 'post',
    data
  })
};

//==============================================================================管理端接口==============================================================================================

/**
 * 查询报名记录
 * @param params
 * @returns {*}
 */
export const queryWorkOrderList = params => {
  return service({
    url: '/manage/get_work_order_list',
    method: 'get',
    params
  })
};

/**
 * 修改报名记录为已处理
 * @param data
 * @returns {*}
 */
export const modifyApply = data => {
  return service({
    url: '/manage/update_work_order?sgin=' + data.sgin + '&workOrderId=' + data.workOrderId,
    method: 'post',
    data
  })
};

/**
 * 查询发布招聘列表
 * @param params
 * @returns {*}
 */
export const queryIssueWork = params => {
  return service({
    url: '/manage/get_work_list',
    method: 'get',
    params
  })
};

/**
 * 查询发布招聘详情
 */
export const queryIssueWorkDetail = params => {
  return service({
    url: '/manage/get_work_detail',
    method: 'get',
    params
  })
};

/**
 * 企业列表信息及企业详情
 * @param params
 * @returns {*}
 */
export const queryMechanismList = params => {
  return service({
    url: '/manage/get_mechanism_list',
    method: 'get',
    params
  })
};

/**
 * 新增修改企业信息
 * @param data
 * @returns {*}
 */
export const insertMechanism = data => {
  return service({
    url: '/manage/insert_or_update_mechanism?sgin=' + data.sgin,
    method: 'post',
    data
  })
};

/**
 * 新增修改招聘信息
 */
export const insertWork = data => {
  return service({
    url: '/manage/insert_or_update_work?sgin=' + data.sgin,
    method: 'post',
    data
  })
};











